package fr.axgame.activities;

import android.app.ActionBar;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.TextView;
import fr.axgame.R;
import fr.axgame.example.FightOneVersusOne;

public class ArenaActivity extends MainActivity {

	private FightOneVersusOne combat = new FightOneVersusOne();
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_arena_layout);
	}
	
	@Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        // getMenuInflater().inflate(R.menu.start, menu);

        // Setup action bar for tabs
        ActionBar actionBar = getActionBar();
        actionBar.setDisplayShowHomeEnabled(false);
        actionBar.setDisplayShowTitleEnabled(false);
		return true;
    }
	
	public void fight(View view) {
		
		TextView lifeHeroTV = (TextView) findViewById(R.id.lifeHeroTextView);
		TextView lifeFoeTV = (TextView) findViewById(R.id.lifeFoeTextView);
		
        try {
            combat.heroAttacksMob();
        } catch (Exception e) {
            e.printStackTrace();
        }
        lifeHeroTV.setText(combat.getHeroLife());
        lifeFoeTV.setText(combat.getMobLife());
    }
}
